/*
 * @Copyright: 2025 Copyright (C) AMCAX, All rights reserved.
 * @Author: Zhang
 * @Date: 2025/7/24 19:39
 * @LastEditTime: 2025/7/24 19:39
 * @LastEditors: Zhang
 * @Description:
 */
import { TopoDialogProps, NMMeshBaseCommand } from '../type';

import { CmdDialogForm } from 'nextcae-base';
import { useEffect, useState } from 'react';
import './index.scss';
import { database } from '@/domain';
import JsonSchemaData from './JsonStructure.json';
import { databaseManager } from '@/common/managers';

const SurfaceProjectionDialog = ({ title, onClose }: TopoDialogProps) => {
  const [schema, setSchema] = useState({});
  const [uiSchema, setUiSchema] = useState({});
  const [formData, setFormData] = useState();

  useEffect(() => {}, []);

  const onSubmit = async () => {
    onClose();
  };
  return (
    <>
      <CmdDialogForm
        title={title}
        schema={schema}
        extraUiSchema={uiSchema}
        formData={formData}
        fields={{}}
        onChange={(data) => {
          setFormData(data.formData);
        }}
        onSubmit={onSubmit}
        onClose={onClose}
        width='300px'
        titleIcon={'commands/surfaceFeatures/extend-patch'}
        formClassName='structure-form'
      />
    </>
  );
};
export const cmdSurfaceProjection: NMMeshBaseCommand = {
  id: 'cmdSurfaceProjection',
  icon: 'commands/surfaceFeatures/extend-patch',
  label: '曲面延拓',
  create: (label: string, onClose: () => void, props) => (
    <SurfaceProjectionDialog
      title={label}
      onClose={onClose}
      props={props}
      placement='topLeft'
    />
  ),
};
